﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using simpleHotel.Business;
using simpleHotel.Data;


namespace simpleHotel.Business
{
    public class EventNews
    {
        public IList<New> getNews()
        {
            List<simpleHotel.Business.New> data = new List<simpleHotel.Business.New>();
            var n = from c in Singleton.DataContext.News
                    select c;
            foreach (New item in n)
            {
                data.Add(item);
            }
            return data;
        }

        public IList<New> getNewbyID(int id)
        {
            List<New> lstNews = new List<New>();
            var n = from c in Singleton.DataContext.News
                    where c.ID == id
                    select c;
            foreach (New item in n)
            {
                lstNews.Add(item);
            }
            return lstNews;

        }
    }
}
